/*
 * @Author: liyin 2179253556@qq.com
 * @Date: 2022-11-16 08:08:04
 * @LastEditors: liyin 2179253556@qq.com
 * @LastEditTime: 2023-09-08 08:29:54
 * @FilePath: \consumption-data-screen\src\router\index.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */

import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  { path: '/', redirect: '/HomeView' },
  {
    path: '/HomeView',
    name: 'HomeView',
    meta: {
      title: '人脸点餐消费数据大屏',
      keetAlive: false
    },
    component: () => import('../components/HomeView.vue')
  },
]

const router = new VueRouter({
  routes
})
/**
 * 解决报错问题：报错显示是路由重复
 * Error: Avoided redundant navigation to current location
 */
 const originalPush = VueRouter.prototype.push
 VueRouter.prototype.push = function push(location) {
   return originalPush.call(this, location).catch(err => err)
 }

export default router
